package com.compty.paint.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 客户收货地址信息
 */
@Entity
@Table(name = "t_addressinfo")
public class AddressInfo {

	private Integer id;
	
	/************ 收货人 ****************/
	private String consignee;
	
	/************ 固话 ****************/
	private String telphone;
	
	/************ 手机 ****************/
	private String mobile;
	
	/************ 邮箱 ****************/
	private String email;
	
	/************ 邮编 ****************/
	private String zipCode;
	
	/************ 街道地址 ****************/
	private String address;
	
	/************ 国家 ****************/
	private CountryInfo countryInfo;
	
	/************ 省份 ****************/
	private ProvinceInfo provinceInfo;
	
	/************ 城市 ****************/
	private CityInfo cityInfo;
	
	/************ 区县 ****************/
	private RegionInfo regionInfo;
	
	private String defaultFlag = "0";//默认收货地址(1:表示默认,0:表示非默认)
	
	private CustomerInfo customerInfo;

	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "consignee", length = 100)
	public String getConsignee() {
		return consignee;
	}

	public void setConsignee(String consignee) {
		this.consignee = consignee;
	}

	@Column(name = "telphone", length = 40)
	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	@Column(name = "mobile", length = 40)
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "email", length = 100)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "zipcode", length = 40)
	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	@Column(name = "address", length = 200)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="countryid")
	public CountryInfo getCountryInfo() {
		return countryInfo;
	}

	public void setCountryInfo(CountryInfo countryInfo) {
		this.countryInfo = countryInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="provinceid")
	public ProvinceInfo getProvinceInfo() {
		return provinceInfo;
	}

	public void setProvinceInfo(ProvinceInfo provinceInfo) {
		this.provinceInfo = provinceInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="cityid")
	public CityInfo getCityInfo() {
		return cityInfo;
	}

	public void setCityInfo(CityInfo cityInfo) {
		this.cityInfo = cityInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="regionid")
	public RegionInfo getRegionInfo() {
		return regionInfo;
	}

	public void setRegionInfo(RegionInfo regionInfo) {
		this.regionInfo = regionInfo;
	}

	@Column(name = "default_flag", length = 10)
	public String getDefaultFlag() {
		return defaultFlag;
	}

	public void setDefaultFlag(String defaultFlag) {
		this.defaultFlag = defaultFlag;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="customer_id")
	public CustomerInfo getCustomerInfo() {
		return customerInfo;
	}

	public void setCustomerInfo(CustomerInfo customerInfo) {
		this.customerInfo = customerInfo;
	}
	
}
